package leetcode;

/**
 * @param
 * @author oyz
 * @version 1.0.4
 * @description: 反转字符串
 * @date 2022/5/25 8:17
 */
public class Code344 {

    public void reverseString(char[] s) {
        int startIndex = 0;
        for (int i = s.length-1; i >=startIndex; i--) {
            char tep = s[startIndex];
            s[startIndex] = s[i];
            s[i] = tep;
            startIndex++;
        }
        for (int i = 0; i < s.length; i++) {
            System.out.println(s[i]);
        }
    }


    public static void main(String[] args) {
        char [] chars = {'H','a','n','n','a','h'};
        new Code344().reverseString(chars);
    }
}
